package com.hovhanna.monopoly.model.deeds;

import com.hovhanna.monopoly.model.Board;
import com.hovhanna.monopoly.model.Player;

public class UtilityDeed extends Deed {
    public UtilityDeed(String name, int price) {
        super(name, price);
    }
    
    @Override
    public int getRent(Board board, Player owner) {
        int value = board.rollDice();
        int count = board.getPlayerOwnedDeedsCount(owner, UtilityDeed.class);
        final int result;
        switch (count) {
            case 1:
                result = 4 * value;
                break;
            default:
                result = 10 * value;
        }
        return result;
    }

}
